package com.easyprogram.notice.pojo;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Date;

/*
* CREATE TABLE `tb_notice` (
  `id` varchar(20) NOT NULL COMMENT 'ID',
  `receiverId` varchar(20) DEFAULT NULL COMMENT '接收消息用户的ID',
  `operatorId` varchar(20) DEFAULT NULL COMMENT '进行操作用户的ID',
  `action` varchar(255) DEFAULT NULL COMMENT '操作类型（评论，点赞等）',
  `targetType` varchar(255) DEFAULT NULL COMMENT '被操作的对象，例如文章，评论等',
  `targetId` varchar(20) DEFAULT NULL COMMENT '被操作对象的id，例如文章的id，评论的id',
  `createtime` datetime DEFAULT NULL COMMENT '发表日期',
  `type` varchar(20) DEFAULT NULL COMMENT '通知类型',
  `state` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章';
* */

@TableName("tb_notice")
public class Notice implements Serializable {
    @TableId(type = IdType.INPUT)
    private String id; //ID
    private String receiverId; //接收消息用户的ID
    private String operatorId; //进行操作用户的ID
    private String action; //操作类型（评论，点赞等）
    private String targetType; //被操作的对象，例如文章，评论等
    private String targetId; //被操作对象的id，例如文章的id，评论的id
    private Date createtime; //发表日期
    private String type; //消息类型 sys系统消息  user用户消息
    private String state; //消息状态（0 未读，1 已读）

    //exist 是否为数据库表字段(默认 true 存在，false 不存在)
    @TableField(exist = false)
    private String operatorName; //进行操作的用户昵称
    @TableField(exist = false)
    private String targetName;//对象名称或简介

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(String receiverId) {
        this.receiverId = receiverId;
    }

    public String getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(String operatorId) {
        this.operatorId = operatorId;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getTargetType() {
        return targetType;
    }

    public void setTargetType(String targetType) {
        this.targetType = targetType;
    }

    public String getTargetId() {
        return targetId;
    }

    public void setTargetId(String targetId) {
        this.targetId = targetId;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getTargetName() {
        return targetName;
    }

    public void setTargetName(String targetName) {
        this.targetName = targetName;
    }

    @Override
    public String toString() {
        return "Notice{" +
                "id='" + id + '\'' +
                ", receiverId='" + receiverId + '\'' +
                ", operatorId='" + operatorId + '\'' +
                ", action='" + action + '\'' +
                ", targetType='" + targetType + '\'' +
                ", targetId='" + targetId + '\'' +
                ", createtime=" + createtime +
                ", type='" + type + '\'' +
                ", state='" + state + '\'' +
                ", operatorName='" + operatorName + '\'' +
                ", targetName='" + targetName + '\'' +
                '}';
    }
}
